	<script type="text/javascript" src="/javascript/jquery.tooltip.execute.js"></script>
	<script type="text/javascript" src="/javascript/jquery.tooltip.v.1.1.js"></script>
	<script type="text/javascript" src="http://www.google.com/jsapi"></script>
	<script type="text/javascript">

		// Load google visualization API
		google.load('visualization', '1', {'packages':['piechart','table','linechart']});
		// On load call draw function
		google.setOnLoadCallback(drawVisualization);
		
		function drawVisualization() {
            // Investments portfolio piechart
	        var data = new google.visualization.DataTable();
	        data.addColumn('string', 'Stock Name');
	        data.addColumn('number', 'Value');
	        data.addRows([{{ pieChartText }}])
	        // Instantiate and draw our chart, passing in some options.
	        var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
	        chart.draw(data, {width: 350, height: 180, is3D: true, title: '{{ piename }}\'s Investments Portfolio'});

            // Line chart of users history
			var dataGraph = new google.visualization.DataTable();
			dataGraph.addColumn('string', 'Date');
			dataGraph.addColumn('number', 'Total Amount');
			{{ graph_text }}

			var chartGraph = new google.visualization.LineChart(document.getElementById('graph_div'));
			chartGraph.draw(dataGraph, {width: 350, height: 180, legend: 'none', title: 'Total Amount In Account'});
	        
            // If user has stocks in portfolio, show table
			{% if showTable %}
			var visualization;
            // Investments portfolio table			 
			var data = new google.visualization.DataTable();
	        data.addColumn('string', 'Stock Name');
       	    data.addColumn('number', 'B. Date');
	        data.addColumn('number', 'B. Value');
	        data.addColumn('number', 'Rate');
	        data.addColumn('number', 'C. Value');
	        data.addColumn('number', 'Update Date');
	        data.addColumn('string', 'Category');
			data.addColumn('string', 'Action');
			{{ table_stocks_Text }}
			var cssClassNames = {headerRow: 'report-table'};
			visualization = new google.visualization.Table(document.getElementById('table'));
			visualization.draw(data, {'allowHtml':true,'width':810,'page':'enable','cssClassNames':cssClassNames});
			{% endif %}
			
			
	      }
		  $(document).ready(function() {
			$("a.toolclass").simpletooltip();
			});	
	    </script>
